package cn.cau.epidemicsurveysystem.bean;

import javax.persistence.Column;
import javax.persistence.Id;
import java.io.Serializable;
import java.util.Objects;

public class StaffInfoEntityPK implements Serializable {
    private int staffId;
    private String staffNo;

    @Column(name = "staffId")
    @Id
    public int getStaffId() {
        return staffId;
    }

    public void setStaffId(int staffId) {
        this.staffId = staffId;
    }

    @Column(name = "staffNo")
    @Id
    public String getStaffNo() {
        return staffNo;
    }

    public void setStaffNo(String staffNo) {
        this.staffNo = staffNo;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        StaffInfoEntityPK that = (StaffInfoEntityPK) o;
        return staffId == that.staffId && Objects.equals(staffNo, that.staffNo);
    }

    @Override
    public int hashCode() {
        return Objects.hash(staffId, staffNo);
    }
}
